package com.atguigu.gulimall.auth.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 实现页面的跳转
 *
 * @Author 胡菜鸡
 * @Create 2022-01-13-17:46
 */
@Configuration
public class GulimallWebConfig implements WebMvcConfigurer {

    /**
     * 视图控制器（直接转发的作用）
     * -     @GetMapping("")
     * -     public String login(){
     * -        return "";
     * -     }
     *
     * @author 胡菜鸡
     * @date 2022/1/13 17:47
     */
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/login.html").setViewName("login");
        registry.addViewController("/register.html").setViewName("register");

    }
}
